<?php

namespace app\admin\model;

use think\Model;

/**
 * Sales
 */
class Sales extends Model
{
    // 表名
    protected $name = 'sales';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;


    public function getEditorAttr($value): string
    {
        return !$value ? '' : htmlspecialchars_decode($value);
    }

    public function creatorTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\emp\Emp::class, 'creator', 'id');
    }
}